// 引入mongoose
const mongoose = require('mongoose');

// 创建一个文档对象结构
let BookSchema = new mongoose.Schema({
    name: String,
    author: String,
    price: Number,
    is_hot: Boolean
})

// 创建一个模型对象 用来操作集合
let BookModel = mongoose.model('books', BookSchema);

module.exports = BookModel;